package trees;

public class BSTNode<T extends Comparable<T>> extends Node<T> {
	private T val;
	private BSTNode<T> left;
	private BSTNode<T> right;

	public BSTNode() {
	}

	public BSTNode(T val) {
		this.val = val;
	}

	public T getVal() {
		return val;
	}

	public void setVal(T val) {
		this.val = val;
	}

	public BSTNode<T> getLeft() {
		return left;
	}

	public void setLeft(BSTNode<T> left) {
		this.left = left;
	}

	public BSTNode<T> getRight() {
		return right;
	}

	public void setRight(BSTNode<T> right) {
		this.right = right;
	}

	@Override
	public String toString() {
		return val.toString();
	}

	@Override
	public boolean isLeaf() {
		return left == null && right == null;
	}
}
